import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        id: '',
        password: '',
        text1: '',
        token: '',
        text2: ''
    },
    mutations: {
        setId(state, data) {
            state.id = data;
        },
        setPassword(state, data) {
            state.password = data;
        },
        setText1(state, data) {
            state.text1 = data;
        },
        setText2(state, data) {
            state.text2 = data;
        },
        setToken(state, data) {
            state.token = data;
        }
    },
    getters: {
        getId: state => state.id,
        getPassword: state => state.password,
        getText1: state => state.text1,
        getToken: state => state.token,
        getText2: state => state.text2,
    },
    actions: {
        setId(context, data) {
            context.commit('setId', data)
        },
        setPassword(context, data) {
            context.commit('setPassword', data)
        },
        setText1(context, data) {
            context.commit('setText1', data)
        },
        setToken(context, data) {
            context.commit('setToken', data)
        },
        setText2(context, data) {
            context.commit('setText2', data)
        }
    }
});